package cn.itcast.controller;

import cn.itcast.pojo.OperateLog;
import cn.itcast.pojo.PageResult;
import cn.itcast.pojo.Result;
import cn.itcast.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/log")
@RestController
@Slf4j
public class LogController {
    @Autowired
    private LogService logService;

    @GetMapping("/page")
    public Result page(Integer page, Integer pageSize){
        PageResult<OperateLog> logPageResult = logService.page(page,pageSize);
        return Result.success(logPageResult);

    }
}
